function [U, V] = rpmf_l11(Y, rk, lambdaU, lambdaV, tol)
%% solve
% |Y - U'V|_1 + lambdaU/2 |U|_F^2 + lambdaV/2 |V|_F^2
%% --------------------------------------------------------------

%% Initialize essencial variables
maxIter = 1000;
[m, n] = size(Y);
U = randn(m, rk);
V = randn(rk, n);
lambda = 1;
eps = 1e-3;
r = abs(Y - U * V);
r = (r < eps) * eps + (r > eps) .* r;
r = (lambda) ./ r;
c = 0;
IS = sparse(eye(rk));
%% Main Process
tic;
while true
    c = c + 1;
    disp(c);
    oldR = r;
   %% Update V
    for i = 1 : n
        T = (U' * diag(sparse(r(:, i))));
            V(:, i) = (T * U + (lambdaV)* IS) \ (T * Y(:, i));
        r(:, i) = abs(Y(:, i) - U * V(:, i));
        r(:, i) = (r(:, i) < eps) * eps + (r(:, i) > eps) .* r(:, i);
        r(:, i) = (lambda) ./ r(:, i);
    end
   %% Update U
    for i = 1 : m
        T = (V * diag(sparse(r(i, :))));
        U(i, :) = (T * V' + lambdaU * IS) \ (T * Y(i, :)');
        r(i, :) = abs(Y(i, :)' - V' * U(i, :)');
        r(i, :) = (r(i, :) < eps) * eps + (r(i, :) > eps) .* r(i, :);
        r(i, :) = (lambda) ./ r(i, :);
    end
    if sum(abs(r(:) - oldR(:))) / sum(oldR(:)) < tol && c ~= 1 || c > maxIter
        break;
    end
end
toc
end